package com.edu.vo;

import java.io.File;
import java.util.Date;

public class FileVO {

    private String name;

    private long lastModified;

    private int fileType;

    private long length;

    private String authority;

    public FileVO(File file) {
        this.name = file.getName();
        this.length = file.length();
        this.lastModified = file.lastModified();
        this.fileType = file.isFile() ? 1 : 0;
        String readable = file.canRead() ? "r" : "-";
        String writable = file.canWrite() ? "w" : "-";
        String executable = file.canExecute() ? "x" : "-";
        this.authority = readable + writable + executable;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public long getLastModified() {
        return lastModified;
    }

    public int getFileType() {
        return fileType;
    }


    public long getLength() {
        return length;
    }

    public String getAuthority() {
        return authority;
    }


}
